package cn.afactory.tygz.ui.base.views.search;

import java.util.ArrayList;
import java.util.EnumMap;
import java.util.List;

/**
 * Created by Kenneth on 15/9/9.
 */
public enum SearchType {
    COMPANY(0, "company", "公司"),
    TOPIC(1, "topic", "话题");

    private int id;
    private String engName;
    private String name;

    private SearchType(int id, String engName, String name) {
        this.id = id;
        this.engName = engName;
        this.name = name;
    }


    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getEngName() {
        return engName;
    }

    private static EnumMap<SearchType, String> mDefaultSearchContents;

    static {
        mDefaultSearchContents = new EnumMap<SearchType, String>(SearchType.class);
        mDefaultSearchContents.put(SearchType.COMPANY, "请输入你要搜索的公司名称");
        mDefaultSearchContents.put(SearchType.TOPIC, "请输入你要搜索的话题");
    }

    /**
     * 获取搜索类型
     *
     * @return
     */
    public static List<SearchTypeEntity> getSearchTypes() {
        List<SearchTypeEntity> list = new ArrayList<SearchTypeEntity>();
        list.add(new SearchTypeEntity(SearchType.COMPANY));
        list.add(new SearchTypeEntity(SearchType.TOPIC));
        return list;
    }

    /**
     * 获取类型提示描述
     *
     * @param searchType
     * @return
     */
    public static String getDefaultSearchContent(SearchType searchType) {
        if (mDefaultSearchContents.containsKey(searchType)) {
            return mDefaultSearchContents.get(searchType);
        } else {
            return mDefaultSearchContents.get(SearchType.COMPANY);
        }
    }

    /**
     * 综合搜索支持类型
     *
     * @return
     */
    public static List<String> getCompSearchTypes() {
        //sick, im, doctor, news, evaluation, medicine, famous_doctor
        List<String> listType = new ArrayList<String>();
        listType.add(SearchType.TOPIC.engName);
        return listType;
    }
}
